#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 5005;
const int B = 2048;

int n, m;
int pos[N];
bitset<B> res[N];
bitset<B> add(bitset<B> bs, int x) {
  rep(i, x, B - 1) {
    if (bs[i])
      bs[i] = 0;
    else {
      bs[i] = 1;
      break;
    }
  }
  return bs;
}
void check_mx(bitset<B>& x, bitset<B> y) {
  per(i, B - 1, 0) {
    if (x[i] < y[i]) {
      x = y;
      return;
    } else if (x[i] > y[i]) {
      return;
    }
  }
}
int ans[1005];
const int MX = 1000;
void mul2() {
  per(i, MX, 0) {
    ans[i] <<= 1;
    if (ans[i] >= 10) ans[i + 1]++, ans[i] %= 10;
  }
}
void add1() {
  rep(i, 0, MX) {
    ans[i] += 1;
    if (ans[i] < 10)
      return;
    else
      ans[i] %= 10;
  }
}
void out(bitset<B> bs) {
  per(i, B - 1, 0) {
    mul2();
    if (bs[i]) add1();
  }
  int h = MX;
  while (h > 0 && !ans[h]) h--;
  per(i, h, 0) cout << ans[i];
  cout << endl;
}
void solve() {
  cin >> n;
  rep(i, 1, n) {
    res[i] = res[i - 1];
    string act;
    int x;
    cin >> act >> x;
    if (act == "win")
      pos[x] = i;
    else if (pos[x])
      check_mx(res[i], add(res[pos[x]], x));
    // cout << i << ' ' << res[i].to_string() << endl;
  }
  out(res[n]);
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  t = 1;
  while (t--) solve();
  return 0;
}